
package nc.impl.hrpbm.fourcgxm.fourcgxm;

import nc.bs.pfxx.plugin.AbstractPfxxPlugin;
import nc.vo.pub.BusinessException;
import nc.bs.pfxx.ISwapContext;
import nc.vo.pfxx.auxiliary.AggxsysregisterVO;
import nc.vo.pfxx.util.PfxxPluginUtils;
import nc.bs.framework.common.NCLocator;
import nc.vo.fourcgxm.fourcgxm.AggFourcgxmVO;
import nc.itf.hrpbm.fourcgxm.fourcgxm.IFourcgxmVOService;

public class FourcgxmVOPfxxPlugin extends AbstractPfxxPlugin {
	
	@Override
	protected Object processBill(Object vo, ISwapContext swapContext, AggxsysregisterVO aggxsysvo)
			throws BusinessException {
		AggFourcgxmVO entityVO = (AggFourcgxmVO)vo;
		String vopk = PfxxPluginUtils.queryBillPKBeforeSaveOrUpdate(swapContext.getBilltype(), swapContext.getDocID());
		entityVO.getParentVO().setPrimaryKey(vopk);
		AggFourcgxmVO[] saveVO = getService().saveAggFourcgxmVO(entityVO);
		return saveVO;
	}
	
	private IFourcgxmVOService getService() {
		return NCLocator.getInstance().lookup(IFourcgxmVOService.class);
	}
}